import multiprocessing
from gevent import monkey

monkey.patch_all()

bind = "0.0.0.0:17724"  # 绑定监听ip和端口号
# forwarded_allow_ips = '0.0.0.0'
preload_app = True  # 预加载资源
workers = multiprocessing.cpu_count() * 1 + 1  # 同时执行的进程数，推荐为当前CPU个数*2+1
threads = multiprocessing.cpu_count() * 1  # 线程数

backlog = 1000  # 等待服务客户的数量，最大为2048，即最大挂起的连接数
worker_connections = 6000  # 默认的最大客户端并发数量
worker_class = "gevent"  # 异步模式
daemon = False  # 是否后台运行
pidfile = './supervisorlogs/gunicore.pid'  # 设置pid文件的文件名
loglevel = 'debug'  # debug error warning error critical
accesslog = './supervisorlogs/gunicorn.log'  # 设置访问日志
errorlog = './supervisorlogs/gunicorn.debug.log'  # 设置问题记录日志
access_log_format = '%(h)s %(t)s %(U)s %(q)s'  # 访问记录格式
